﻿<Window x:Class="DesktopWindow"
        x:Name="DesktopWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="DesktopWindow" Height="150" Width="240"
    WindowStyle="None"
    ShowInTaskbar="False"
    AllowsTransparency="True"
    Background="Transparent"        
    xmlns:local="clr-namespace:TrippLite"
           
    >
    
    <Grid>

        <Grid.RowDefinitions>
            <RowDefinition Height="16" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        

        <Border CornerRadius="16,0,16,16"
                Grid.Row="1"
                Grid.ColumnSpan="3"
                Background="{StaticResource TrippLiteLcdTrans}"
                BorderBrush="{StaticResource TrippLiteLcd}"
                BorderThickness="1"
                >

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="24" />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition Height="4" />
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="16" />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition Width="16" />
                </Grid.ColumnDefinitions>

                
                <Grid Grid.Column="1"
                      Grid.ColumnSpan="2"
                      Margin="4,2,4,0"
                      Opacity="0.75">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    
                    <Border CornerRadius="4"
                            Grid.Column="0"
                            Background="{StaticResource TrippLiteGray}">

                        <Image 
                            Margin="2,2,2,2"
                            RenderOptions.BitmapScalingMode="HighQuality"
                            Source="{StaticResource TrippLiteLogo}">

                        </Image>

                    </Border>

                    <TextBlock Style="{StaticResource SmallNormalProperty}"
                               Grid.Column="1"
                               Text="{Binding ElementName=DesktopWindow,Path=ModelId,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}" />

                </Grid>


                <StackPanel Grid.Row="1"
                            Grid.Column="1"
                            VerticalAlignment="Stretch">

                    <ItemsControl
                        x:Name="LoadItem"
                        Focusable="False"
                        ItemTemplate="{StaticResource CoolItemTemplate}"
                        ItemsSource="{Binding LoadProperties}"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Top"
                        Background="Transparent"
                        BorderThickness="0"
                    />

                </StackPanel>

                <StackPanel Grid.Row="1"
                            Grid.Column="2"
                            Grid.RowSpan="2"
                            VerticalAlignment="Stretch">

                    <ItemsControl
                        x:Name="BigItems"
                        Focusable="False"
                        ItemTemplate="{StaticResource CoolItemTemplate}"
                        ItemsSource="{Binding ProminentProperties}"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Top"
                        Background="Transparent"
                        BorderThickness="0"
                    />

                </StackPanel>


                <local:LoadBar 
                        Grid.Row="2"
                        Grid.Column="1"
                        Margin="0,-6,0,0"
                        x:Name="LoadVisual"
                        LoadValue="{Binding LoadBarValue,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Height="24"
                        Width="88"/>
               
                
            </Grid>


        </Border>

        <Border Grid.Column="2"
                Grid.Row="0"
                CornerRadius="16,16,0,0"
                Background="{StaticResource TrippLiteLcdTrans}"
                BorderBrush="{StaticResource TrippLiteLcd}"
                
                >

            <Grid>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Button x:Name="MoveButton"
                        Grid.Column="0"
                        Width="16"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Background="Transparent"
                        BorderBrush="Transparent"
                        BorderThickness="0"
                        Focusable="False"
                        Height="16" Margin="10,0,2,0">


                    <Image Source="{StaticResource WindowMoveImage}"
                           Stretch="Uniform"
                           RenderOptions.BitmapScalingMode="HighQuality"
                           Width="14"
                           Height="14"
                           />
                </Button>

                <Button x:Name="OptionsButton"
                        Grid.Column="1"
                        Width="16"
                        Height="16"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Background="Transparent"
                        BorderBrush="Transparent"
                        BorderThickness="0"
                        Focusable="False"
                        Margin="2,0,2,0">
                    
                    <Image Source="{StaticResource WindowOptionsImage}"
                           Stretch="Uniform"
                           RenderOptions.BitmapScalingMode="HighQuality"
                           Width="14"
                           Height="14"
                           />

                    <Button.ContextMenu>
                        <ContextMenu x:Name="OptionsMenu">
                            <MenuItem x:Name="RevertToBig" Header="Display Large Monitor" />
                            <Separator />
                            <MenuItem x:Name="SysPower" Header="Open System Power Options" />
                        </ContextMenu>
                    </Button.ContextMenu>


                </Button>

                <Button x:Name="CloseButton"
                        Grid.Column="2"
                        Width="16"
                        Height="16" 
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Background="Transparent"
                        BorderBrush="Transparent"
                        BorderThickness="0"
                        Focusable="False"
                        Margin="2,0,10,0">
                    
                    <Image Source="{StaticResource WindowCloseImage}"
                           Stretch="Uniform"
                           RenderOptions.BitmapScalingMode="HighQuality"
                           Width="14"
                           Height="14"
                           />
                </Button>

            </Grid>
            
        </Border>

    </Grid>
    
    
    
</Window>
